﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site_Admin.Master" Inherits="System.Web.Mvc.ViewPage<Proyecto_e.Models.pregunta>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Editar
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script> 
<script src="/Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>

<script type="text/javascript">
    var variable = 0;

    function iniciar() {
        nodoTabla = document.getElementById("tabla1");
    }

    function identificador() {
        nodoFila = document.createElement("tr");
        nodoTabla.appendChild(nodoFila);
        almacenar1(nodoFila, "No");
        almacenar1(nodoFila, "Respuesta");
        almacenar1(nodoFila, "Acciones");
    }

    function almacenar1(nodoFila, valor) {
        nodoCelda = document.createElement("th");
        valorTexto = document.createTextNode(valor);
        nodoCelda.appendChild(valorTexto);
        nodoFila.appendChild(nodoCelda);
    }

    function almacenar(nodoFila, valor) {
        nodoCelda = document.createElement("td");
        valorTexto = document.createTextNode(valor);
        nodoCelda.appendChild(valorTexto);
        nodoFila.appendChild(nodoCelda);
    }

    function eliminar() {
        while (nodoTabla.childNodes.length > 0) {
            nodoTabla.removeChild(nodoTabla.lastChild);
        }
        identificador();
    }

    function agregar() {
        nodoTabla = document.getElementById("tabla1");
        nodoFila = document.createElement("tr");
        nodoTabla.appendChild(nodoFila);
        almacenar(nodoFila, document.getElementById("tabla1").rows.length - 2);
        almacenar(nodoFila, document.getElementById("respuesta").value);
        almacenar(nodoFila, "Editar Eliminar");
    }

</script>

<% using (Html.BeginForm("NuevaPregunta", "Pregunta", FormMethod.Post))
   { %>

     <form name="form1" id="form1" method="post" runat="server">
    <div style="text-align: left">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="/Usuarios/Inicio_Usuario">&nbsp;Inicio</asp:HyperLink>&nbsp;>> 
        <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="/Encuesta /editar">&nbsp;Editar Encuesta</asp:HyperLink>
        <span style="color: #000000"><strong style="text-align: center">&nbsp;&nbsp;</strong><span 
            style="text-align: center; font-size: small">&gt;&gt; Editar Pregunta</span><strong 
            style="text-align: center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Editar pregunta</strong></span>
        
        
        <br style="color: #000000" />
        <br style="color: #000000" />
        <span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        Seleccione el tipo de pregunta:
        <select id="id_tipo_pregunta" name="D1">
            <option> Respuesta &uacute;nica</option>
            <option> M&uacute;ltiple respuesta</option>
            <option> Respuesta desplegable</option>
            <option> Respuesta abierta</option>
        </select><br />
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Enunciado de la pregunta:&nbsp;&nbsp;
        </span>
        <textarea id="enunciado" name="S1" rows="2" style="color: #000000"></textarea><span 
            style="color: #000000"><br />
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Respuestas</span><br />
        <br />
       <table align="center" width="450" border="1">	           	   
		      <tbody id="tabla1" >		
		       <tr>			
			     <th style="color: #000000"><span style="font-weight: normal; color: #000000">No</span></th>
			     <th><span style="font-weight: normal; color: #000000">Respuesta</span></th>
			     <th><span style="font-weight: normal; color: #000000">Acciones</span></th>			    
		       </tr>	                      		   	  
		       </tbody>
	   </table>

        <div style="text-align: left">
            <span style="color: #000000">
            <br />
            <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <strong style="text-align: left">Nueva Respuesta<br />
            <br />
            </strong></span></div>
             <span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             Respuesta:&nbsp;&nbsp;&nbsp; </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <textarea id="respuesta" name="S2" rows="2"></textarea>&nbsp;&nbsp;&nbsp;&nbsp;
        <input id="Ok" type="button" value="Ok" onclick="agregar()"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <br />
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button 
            ID="Button4" runat="server" PostBackUrl="/Encuesta/create" Text="Cancelar" />
        &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
        <input id="Button2" type="submit" value="Guardar" /></div>

    </form>
<% } %>

</asp:Content>
